package com.wxq.ams.backup.service.impl;

import com.wxq.ams.backup.service.MysqlBackupService;
import com.wxq.ams.backup.utils.BackupUtils;
import com.wxq.ams.backup.utils.SqlExecUtils;
import org.springframework.stereotype.Service;

@Service
public class MysqlBackupServiceImpl implements MysqlBackupService {
    @Override
    public boolean backup(String host, String username, String password, String backupFolderPath, String fileName, String database) throws Exception {
        return BackupUtils.backup(host, username, password, backupFolderPath, fileName, database);
    }

    @Override
    public boolean restore(String restoreFilePath, String host, String userName, String password, String port, String database) throws Exception {
        return SqlExecUtils.sqlExec(host, database, userName, password, port, restoreFilePath);
    }
}
